<?php
    define('ACC', true);
require('./include/init.php');
session_start(); 
//print_r($_SESSION);
$userid = $_SESSION['user_id'];

echo '<head><meta charset = "utf-8"></head>';  
//$userid = 26;
 echo '<h2>日记账&nbsp&nbsp<a href = "dashboard.php">返回虚拟公司主页</a></h2><br/>';   
 
$company = new companymodel();
$companyinfo = $company->getcompanyinfo($userid);
$companyid = $companyinfo['company_id'];
$accounting = new accountingmodel();
 
echo '<h2>公司名称为:' . $companyinfo['company_name'], '&nbsp|&nbsp';
echo '目前所在财年:第' . $companyinfo['company_y'] . '财年', '&nbsp|&nbsp';
echo '目前所在季度:第' . $companyinfo['company_q'] . '季度', '</h2><br/><br/><br/>';

$order = $company->getorder($companyid);

echo '<table border="1">
<tr><th>产品名称</th><th>数量</th><th>价格</th><th>付款周期</th><th>备注</th></tr>';

foreach($order as $k=>$v){
    echo '<tr><td>' . $company->getelementname($v['element_id']) . '</td><td>' . $v['order_number'] . '</td><td>' . $v['order_price'] . '</td><td>' . $v['order_payment'] . '个季度</td><td></td></tr>';
} 
echo '</table>';


?>
